﻿using System;
using System.Web.Mvc;
using System.Web.Routing;
using Morus;

namespace KAKA.Controllers
{
    public class ControllerFactory : DefaultControllerFactory
    {
        protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
        {
            return controllerType == null ?
                base.GetControllerInstance(requestContext, controllerType) :
                (IController)IoC.Resolve(controllerType);
        }
    }
}